import React from 'react'
import ReactDOM from 'react-dom'


import App from './components/App'
import store from './redux/store'




console.log('index1', store)
console.log('index2', store.getState)

ReactDOM.render(
  // 安裝 redux
  // cnpm install --save redux
  <React.StrictMode>
    <App store={store} />
  </React.StrictMode>,
  document.getElementById('root')
);

function render() {
  ReactDOM.render(
    // 安裝 redux
    // cnpm install --save redux
    <React.StrictMode>
      <App store={store} />
    </React.StrictMode>,
    document.getElementById('root')
  );
}
// 初始化渲染
render()
// 订阅监听(state中的变化, 就会自动调用进行重绘)
store.subscribe(render)

